function ShowSnsBar() {
  var bar = $('#sns-share-bar');
  bar.html('<span style="float:left;color:#448;font-weight:normal;font-size:11px;line-height:18px;">分享到 : </span> <a id="renren-share" class="sns-share" title="人人网" href="#nogo"></a>'
    + '<a id="douban-share" class="sns-share" title="豆瓣" href="#nogo" ></a>'
    + '<a id="sina-t-share" class="sns-share" title="新浪微博" href="#nogo" ></a>'
    + '<a id="qq-t-share" class="sns-share" title="腾讯微博" href="#nogo" ></a>');
    
  var esc = encodeURIComponent;
  function GetWinParas(width, height) {
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2 - 10;
    return 'toolbar=0,resizable=1,scrollbars=yes,status=0,width=' 
      + width + ',height=' + height + ',top=' + top + ',left=' + left;
  }

  function Report(postfix) {
    $(document.body).append($('<img src="http://static.slowrose.com/stat/' + postfix + '"/>'));
  }

  $('#renren-share', bar).click(
    function() {
      var url = 'http://share.renren.com/share/buttonshare.do?link=' 
          + esc(location.href) + '&title=' + esc(document.title);
      window.open(url, 'renren', GetWinParas(606, 356));
      Report('share.png?aid=' + article_id + '&share=renren');
    }
  );
  $('#douban-share', bar).click(
    function() {
      var url = 'http://www.douban.com/recommend/?url=' + esc(location.href) + '&title=' + esc(document.title);
      window.open(url, 'douban', GetWinParas(470, 360));
      Report('share.png?aid=' + article_id + '&share=douban');
    }
  );

  $('#sina-t-share', bar).click(
    function() {
      var url = 'http://v.t.sina.com.cn/share/share.php?appkey=2566392091&url='
          + esc(location.href) + '&title=' + esc(document.title) + '&source=' + esc('SlowRose价值投资博客')
          + '&sourceUrl=' + esc('http://www.slowrose.com/') + '&content=utf-8&pic=';
      window.open(url, 'sina-t', GetWinParas(440, 430));
      Report('share.png?aid=' + article_id + '&share=sina-t');
    }
  );

  $('#qq-t-share', bar).click(
    function() {  
      var url = 'http://v.t.qq.com/share/share.php?title='+ esc(document.title)
        + '&url=' + esc(document.location) + '&site=' + esc('http://www.slowrose.com') + '&pic=';
      window.open(url, 'qq-t', GetWinParas(680, 480));
      Report('share.png?aid=' + article_id + '&share=qq-t');
    }
  );
}

$(document).ready(
  function() {
    ShowSnsBar();
  }
);
